package com.etc.test;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.etc.entity.MedicalHistory;
import com.etc.service.MedicalHistoryService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml", "classpath:mybatis-config.xml" })
public class MedicineHistoryTestJUnit {

	@Autowired
	private MedicalHistoryService medicalHistoryService ;
	
	
	/**
	 * 多表链接分页查询病史测试
	 */
	@Test
	public void selectMedicalHistoryByJoin() {
		List<MedicalHistory> medicalHistory = medicalHistoryService.selectMedicineByJoin(1,1);
		medicalHistory.forEach(System.out::println);
	}
	
	/**
	 * 查询病史总数量
	 */
	@Test
	public void countMedicalHistory() {
		int count = medicalHistoryService.countMedicineHistory();
		System.out.println(count);
	}
}
